{template '_header'}
<!--<script>document.title = "{if empty($this->merch_user)}{$_W['shopset']['shop']['name']}{else}{php echo $this->merch_user['merchname']}{/if}"</script>-->
<link rel="stylesheet" href="../addons/ewei_shopv2/plugin/creditshop/template/mobile/default/images/common.css" />
<link rel="stylesheet" href="../addons/ewei_shopv2/plugin/creditshop/static/css/common.css" />
<style type="text/css">
    .fui-navbar ~ .fui-content, .fui-content.navbar{padding:0;}
</style>
<div class='fui-page  fui-page-current creditshop-index-page'>
    {if is_h5app()}
    <div class="fui-header">
        <div class="fui-header-left"></div>
        <div class="title">{$_W['shopset']['trade']['credittext']}商城</div>
        <div class="fui-header-right"></div>
    </div>
    {/if}
    <div class='fui-content navbar'>
        {if !empty($advs)}
        <div class='fui-swipe' data-transition="500" data-gap="1">
            <div class='fui-swipe-wrapper'>
                {loop $advs $adv}
                <a class='fui-swipe-item external' href="{if !empty($adv['link'])}{$adv['link']}{else}javascript:;{/if}"><img src="{php echo tomedia($adv['thumb'])}" /></a>
                {/loop}
            </div>
            <div class='fui-swipe-page'></div>
        </div>
        {/if}
        <div class="menu">
            <a class="item" href="javascript:void(0);">
                <span class="text"><i class="icon icon-jifen"></i> {$_W['shopset']['trade']['credittext']}{$credit}</span>
            </a>
            <a class="item" href="{php echo mobileUrl('creditshop/creditlog')}">
                <span class="text"><i class="icon icon-navlist"></i> 参与记录</span>
            </a>
        </div>
        {if count($category)>0 && !empty($category)}
        <div class="fui-icon-group noborder circle" style="margin-top: 0.5rem">
            {loop $category $cate}
            <div class="fui-icon-col">
                <a href="{php echo mobileUrl('creditshop/lists', array('cate'=>$cate['id']))}" class="external">
                    <div class="icon"><img src="{php echo tomedia($cate['thumb'])}"></div>
                    <div class="text">{$cate['name']}</div>
                </a>
            </div>
            {/loop}
        </div>
        {/if}
        <!--特色抽奖区-->
        {if count($lotterydraws)>0 && !empty($lotterydraws)}
        <div class="fui-cell-group fui-cell-click">
            <a class="fui-cell">
                <div class="fui-cell-icon"><i class="icon icon-gifts"></i></div>
                <div class="fui-cell-text"><p>抽奖专区</p></div>
            </a>
        </div>
        <div class="fui-goods-group white block">
            {loop $lotterydraws $item}
            <a class="fui-goods-item" href="{php echo mobileUrl('creditshop/detail',array('id'=>$item['id']))}" data-nocache="true">
                <div class="image" data-lazyloaded="true" style="background-image: url('{php echo tomedia($item['thumb'])}');"></div>
                <div class="detail">
                    <div class="name">
                        <span class="fui-subtext">
                            {if $item['goodstype']==0}商品{/if}
                            {if $item['goodstype']==1}优惠券{/if}
                            {if $item['goodstype']==2}余额{/if}
                            {if $item['goodstype']==3}红包{/if}
                        </span>
                        {$item['title']}
                    </div>
                    <div class="price" style="display: block;">
                        <span style="font-size: 0.5rem">
                            <span style="font-size: 0.8rem;font-weight: bold;padding-right: 0.1rem;">{$item['credit']}</span>
                            <span style="color:#999;">{$_W['shopset']['trade']['credittext']}</span>
                            {if $item['money'] > 0}
                             + <span style="font-size: 0.8rem;font-weight: bold;padding-right: 0.1rem;">&yen;{$item['money']}</span>
                            {/if}
                        </span>
                        <span class="fui-text text-danger" style="float:right;">抽奖</span>
                    </div>
                </div>
            </a>
            {/loop}
        </div>
        {/if}
        <!--{$_W['shopset']['trade']['credittext']}实物兑换-->
        {if count($exchanges)>0 && !empty($exchanges)}
        <div class="fui-cell-group fui-cell-click">
            <a class="fui-cell">
                <div class="fui-cell-icon"><i class="icon icon-gifts"></i></div>
                <div class="fui-cell-text"><p>{$_W['shopset']['trade']['credittext']}实物兑换</p></div>
            </a>
        </div>
        <div class="fui-goods-group white block">
            {loop $exchanges $item}
            <a class="fui-goods-item" href="{php echo mobileUrl('creditshop/detail',array('id'=>$item['id']))}" data-nocache="true">
                <div class="image" data-lazyloaded="true" style="background-image: url('{php echo tomedia($item['thumb'])}');"></div>
                <div class="detail">
                    <div class="name">
                        {$item['title']}
                    </div>
                    <div class="price" style="display: block;">
                        <span style="font-size: 0.5rem">
                            <span style="font-size: 0.8rem;font-weight: bold;padding-right: 0.1rem;">{$item['credit']}</span>
                            <span style="color:#999;">{$_W['shopset']['trade']['credittext']}</span>
                            {if $item['money'] > 0}
                             + <span style="font-size: 0.8rem;font-weight: bold;padding-right: 0.1rem;">&yen;{$item['money']}</span>
                            {/if}
                        </span>
                        <span class="fui-text text-danger" style="float:right;">兑换</span>
                    </div>
                </div>
            </a>
            {/loop}
        </div>
        {/if}

        <!--红包兑换区-->
        {if count($redbags)>0 && !empty($redbags)}
        <div class="fui-cell-group fui-cell-click">
            <a class="fui-cell">
                <div class="fui-cell-icon"><i class="icon icon-gifts"></i></div>
                <div class="fui-cell-text"><p>红包兑换区</p></div>
            </a>
        </div>
        <div class="fui-goods-group white block">
            {loop $redbags $item}
            <a class="fui-goods-item" href="{php echo mobileUrl('creditshop/detail',array('id'=>$item['id']))}" data-nocache="true">
                <div class="image" data-lazyloaded="true" style="background-image: url('{php echo tomedia($item['thumb'])}');"></div>
                <div class="detail">
                    <div class="name">{$item['title']}</div>
                    <div class="price" style="display: block;">
                        <span style="font-size: 0.5rem">
                            <span style="font-size: 0.8rem;font-weight: bold;padding-right: 0.1rem;">{$item['credit']}</span>
                            <span style="color:#999;">{$_W['shopset']['trade']['credittext']}</span>
                            {if $item['money'] > 0}
                             + <span style="font-size: 0.8rem;font-weight: bold;padding-right: 0.1rem;">&yen;{$item['money']}</span>
                            {/if}
                        </span>
                        <span class="fui-text text-danger" style="float:right;">兑换</span>
                    </div>
                </div>
            </a>
            {/loop}
        </div>
        {/if}

        <!--{$_W['shopset']['trade']['credittext']}兑换券-->
        {if count($coupons)>0 && !empty($coupons)}
        <div class="fui-cell-group fui-cell-click">
            <a class="fui-cell">
                <div class="fui-cell-icon"><i class="icon icon-gifts"></i></div>
                <div class="fui-cell-text"><p>{$_W['shopset']['trade']['credittext']}兑换劵</p></div>
            </a>
        </div>
        <div class="fui-goods-group">
            {loop $coupons $item}
            <a class="fui-goods-item" href="{php echo mobileUrl('creditshop/detail',array('id'=>$item['id']))}" data-nocache="true">
                <div class="image" data-lazyloaded="true" style="background-image: url('{php echo tomedia($item['thumb'])}');"></div>
                <div class="detail">
                    <div class="name">{$item['title']}</div>
                    <div class="price" style="display: block;">
                        <span style="font-size: 0.5rem">
                            <span style="font-size: 0.8rem;font-weight: bold;padding-right: 0.1rem;">{$item['credit']}</span>
                            <span style="color:#999;">{$_W['shopset']['trade']['credittext']}</span>
                            {if $item['money'] > 0}
                             + <span style="font-size: 0.8rem;font-weight: bold;padding-right: 0.1rem;">&yen;{$item['money']}</span>
                            {/if}
                        </span>
                        <span class="fui-text text-danger" style="float:right;">兑换</span>
                    </div>
                </div>
            </a>
            {/loop}
        </div>
        {/if}
        <!--余额兑换区-->
        {if count($balances)>0 && !empty($balances)}
        <div class="fui-cell-group fui-cell-click">
            <a class="fui-cell">
                <div class="fui-cell-icon"><i class="icon icon-gifts"></i></div>
                <div class="fui-cell-text"><p>余额兑换区</p></div>
            </a>
        </div>
        <div class="fui-goods-group white block">
            {loop $balances $item}
            <a class="fui-goods-item" href="{php echo mobileUrl('creditshop/detail',array('id'=>$item['id']))}" data-nocache="true">
                <div class="image" data-lazyloaded="true" style="background-image: url('{php echo tomedia($item['thumb'])}');"></div>
                <div class="detail">
                    <div class="name">{$item['title']}</div>
                    <div class="price" style="display: block;">
                        <span style="font-size: 0.5rem;">
                            <span style="font-size: 0.8rem;font-weight: bold;padding-right: 0.1rem;">{$item['credit']}</span>
                            <span style="color:#999;">{$_W['shopset']['trade']['credittext']}</span>
                            {if $item['money'] > 0}
                             + <span style="font-size: 0.8rem;font-weight: bold;padding-right: 0.1rem;">&yen;{$item['money']}</span>
                            {/if}
                        </span>
                        <span class="fui-text text-danger" style="float:right;">兑换</span>
                    </div>
                </div>
            </a>
            {/loop}
        </div>
        {/if}
    </div>

</div>


{php $this->footerMenus()}

{template '_footer'}